#include <STC15F2K60S2.H>
#include "nixie.h"
#include "latch.h"
#include "timer.h"
#include "kbd.h"

unsigned char Keynumber = 0,b = 0;

void main()
{
	latch(LED,0xaa);
	latch(RELAY,0x00);
	Timer2Init();
	while(1)
	{
		Keynumber = key_return();
		if(Keynumber)
			b = Keynumber;
			nixieshow(1,b/10);
			nixieshow(2,b%10);

		}
}

void timer2() interrupt 12 using 1
{
	static unsigned char count = 0;
	T2L = 0x66;		//设置定时初值
	T2H = 0xEA;		//设置定时初值
	if(++count == 10)
	{
	key_loop();
		count = 0;
	}
}